home *** CD-ROM | disk | FTP | other *** search
/ IRIX 6.4 Applications 1997 August / SGI IRIX 6.4 Applications 1997 August.iso / dist / mmailp.idb / usr / lib / Zmail / bin / metapara.z / metapara
Encoding:
Text File  |  1997-01-22  |  829 b   |  30 lines

  1. :
  2. # metapara
  3. #    makes metamail multipart/parallel work more or less as advertised
  4. # NOTE: *extremely* labor intensive!!!
  5. #
  6. # You also need a line something like this in mailcap:
  7. #
  8. #    multipart/parallel; metapara %{boundary} %s
  9. #
  10. # Bill Carpenter, Jun 94,  bill@attmail.com
  11. #
  12. BOUNDARY="$1"
  13. INFILE="$2"
  14. cd /usr/tmp  # more space where I live (metamail uses /tmp)
  15. STUB=wjc.$$.
  16.  
  17. # get rid of leading delimiter line before splitting
  18. cat $INFILE | (read leader   &&   csplit -f $STUB - "/^--$BOUNDARY\$/")
  19.  
  20. # too bad csplit can't somehow write parts to stdout or exec something
  21. # on them
  22. for subpart in $STUB??
  23. do
  24.     # -B means no prompting; run in background to get parallelism
  25.     # NOTE: probably still sync problems for most stuff anyhow
  26.     ( metamail -B $subpart; rm $subpart ) &
  27. done
  28.  
  29. # metamail takes care of nuking $INFILE itself
  30.